#ifndef _GameScene_H_
#define _GameScene_H_

#include "cocos2d.h"
USING_NS_CC;

class Ball;

class GameScene:public cocos2d::Layer
{
public:
	static cocos2d::Scene* createScene();
	CREATE_FUNC(GameScene);
	bool init();
	void update(float dt);
    void runAndhitUpdate(float dt);
    void removeUpdate(float dt);
    void rewardUpdate(float dt);
    
	bool onTouchBegain(Touch* touch, Event* event);
	void onTouchMoved(Touch* touch, Event* event);
    
    float speed = 600.0f;
    float offsetY;
    Node *bg;
    Ball *ball;
    
private:
	//EventListenerTouchOneByOne* touchlistener;
	float lastTouchX;
	Size visibleSize;
	void try2MoveX(float detaX);
private:
    int score = 0;
	bool isOver = false;
    
    Label* scoreLabel;
};

#endif
